package com.qlk.odcinterface.dao.impl;

import com.qlk.common.dao.mybatis.BaseDao;
import com.qlk.odcinterface.dao.PmsCouponItemDao;
import com.qlk.odcinterface.domain.PmsCouponItem;
import com.qlk.odcinterface.domain.query.PmsCouponItemQuery;

import java.util.List;
import org.springframework.stereotype.Repository;

/**
 * PmsCouponItemDAO实现类<br/>
 * 对'单品促销明细表'表进行基本的操作
 * 
 * @author zhaoyanan
 * @version 2016-4-14 14:11:36
 * 
 */
@Repository
public class PmsCouponItemDaoImpl extends BaseDao implements PmsCouponItemDao {
    /** namespace */
    private final String namespace = PmsCouponItemDaoImpl.class.getName();
    
    /**
     * {@inheritDoc}
     */
    public List<PmsCouponItem> queryPmsCouponItemList(PmsCouponItemQuery queryBean) {
        return (List<PmsCouponItem>) queryForList(namespace +".queryPmsCouponItemList", queryBean);
    }

    /**
     * {@inheritDoc}
     */
    public boolean insert(PmsCouponItem pmsCouponItem) {
        return insert(namespace +".insert", pmsCouponItem);
    }

    /**
     * {@inheritDoc}
     */
    public boolean update(PmsCouponItem pmsCouponItem) {
        return update(namespace +".update", pmsCouponItem);
    }

    /**
     * {@inheritDoc}
     */
    public int queryPmsCouponItemCount(PmsCouponItemQuery queryBean) {
        return (Integer) queryForObject(namespace +".queryPmsCouponItemCount", queryBean);
    }

    /**
     * {@inheritDoc}
     */
    public List<PmsCouponItem> queryPmsCouponItemListWithPage(PmsCouponItemQuery queryBean) {
        return (List<PmsCouponItem>) queryForList(namespace +".queryPmsCouponItemListWithPage", queryBean);
    }

    /**
     * {@inheritDoc}
     */
    public boolean delete(PmsCouponItem configuration) {
        return delete(namespace +".delete", configuration);
    }

    /**
     * {@inheritDoc}
     */
    public PmsCouponItem getPmsCouponItemById(Long id) {
        return (PmsCouponItem) queryForObject(namespace +".getPmsCouponItemById", id);
    } 
    
    /**
     * {@inheritDoc}
     */
    public boolean exist(PmsCouponItem pmsCouponItem) {
        int count = (Integer) queryForObject(namespace +".exist", pmsCouponItem);
        return count > 0;
    }
}
